#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>
#include <QSpacerItem>
#include <QHBoxLayout>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QHBoxLayout* layout = new QHBoxLayout(this);
    QPushButton* bt1 = new QPushButton("按钮1");
    QPushButton* bt2 = new QPushButton("按钮2");

    // 创建空白
    QSpacerItem* space = new QSpacerItem(200,10);

    layout->addWidget(bt1);
    layout->addSpacerItem(space);
    layout->addWidget(bt2);
}

Widget::~Widget()
{
    delete ui;
}

